#ifndef TEXT_H
#define TEXT_H

#include <map>
#include <iostream>
#include <glad/glad.h>
#include <glm/gtc/type_ptr.hpp>

#include <ft2build.h>
#include FT_FREETYPE_H

#include "Shader.h"
#include "Util.h"

struct Character {
	GLuint TextureID;   // ID handle of the glyph texture
	glm::ivec2 Size;    // Size of glyph
	glm::ivec2 Bearing;  // Offset from baseline to left/top of glyph
	GLuint Advance;    // Horizontal offset to advance to next glyph
};


class Text {
public:
	Text(const std::string fileName, Shader &shader);
	GLvoid Draw(std::string text, GLfloat x, GLfloat y, GLfloat scale, glm::vec3 color);
private:
	Shader m_shader;
	GLuint m_VAO, m_VBO;
	std::map<GLchar, Character> m_Characters;

	GLvoid InitMesh();
};

#endif
